﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Garden.Model;
using Kaixin.BLL;
using Kaixin.BLL.Helper;
using RegexHelper = Garden.Helper.RegexHelper;
namespace Garden.Func
{
    class WaterMan: WorkMan
    {
        public WaterMan()
        {
            WhichPage = "water";
        }
        protected override bool WorkCondition(Farmland land)
        {
            return land.Status == 1 && land.Water < 5;
        }

        protected override void WorkSummary(Farmland land, LogWrite log, string data)
        {
            string val = RegexHelper.GetFirstVal(data, RegexHelper.RetReg);
            log(string.Format("{0}号地：浇水{1}", land.FarmNum, val));
        }
    }
}
